#include "tree.cpp"

int main() {
	BinaryTree<char> Tree('@');
	if (Tree.IsEmpty()) {
		cout << "此时二叉树为空" << endl;
	}
	ifstream ifs("tree.txt");
	if (!ifs.is_open()) {
		cout << "> 找不到存放树结构的文件！" << endl;
		system("pause");
		return 0;
	}
	Tree.CreatePreOrder(ifs);
	ifs.close();
	cout << "********************************************" << endl;
	if (!Tree.IsEmpty()) {
		cout << "此时二叉树不为空" << endl;
	}
	cout << Tree.GetRoot()->data << endl;
	cout << Tree.GetRoot()->LeftSubtree->data << endl;
	cout << Tree.GetRoot()->RightSubtree->data << endl;
	cout << "前序遍历： ";
	Tree.PreOrder();
	cout << endl;
	cout << "中序遍历： ";
	Tree.InOrder();
	cout << endl;
	cout << "后序遍历： ";
	Tree.PostOrder();
	cout << endl;
	cout << "节点树： ";
	cout << Tree.Size() << endl;
	cout << "树的高： ";
	cout << Tree.Height() << endl;
	system("pause");
	return 0;
}